<template>
	<view class="heart-day">
		<view class="heart-echart">
			<view>
				<text><text class="tap">{{data.heartRate}}</text>次/分</text>
			</view>
			<view class="echart">
				<indexLineVue :parent-data="listData"></indexLineVue>
			</view>
		</view>
		<view class="heart-overview">
			<view>
				<image src="/static/index/overview.png"></image>
				<text>今日概况</text>
			</view>
			<view class="heart-content">
				<view>
					<text><text class="tap">{{data.resting}}</text>次/分</text>
					<text>静息心率</text>
				</view>
				<view>
					<text><text class="tap">{{data.highest}}</text>次/分</text>
					<text>最高心率</text>
				</view>
				<view>
					<text><text class="tap">{{data.lowest}}</text>次/分</text>
					<text>最低心率</text>
				</view>
				<view>
					<text><text class="tap">{{data.average}}</text>次/分</text>
					<text>平均心率</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script setup>
	import { reactive, ref } from 'vue';
import indexLineVue from '../../../ucharts/heart/indexLine.vue';
// import { getHeartDayInfo } from '../../../../utils/api/index/heart/heartDay';
    //父组件数据
	const data=ref({
		heartRate:60,
		resting:60,
		lowest:60,
		highest:99,
		average:parseInt((60+60+60+99)/4)
	})
	//子组件数据
	const listData=reactive([]);
	//获取后端传入的数据
	// getHeartDayInfo().then(res=>{
	// 	data.value=res.data;
	// 	listData=res.data.list;
	// }).catch(error=>{
	// 	console.log("数据请求失败！",error);
	// })
</script>

<style scoped>
	.heart-day{
		paddingr:0rpx 10rpx 0rpx 10rpx;
		margin-top:240rpx;
		height: 1300rpx;
		display: flex;
		flex-direction: column;
		flex-wrap: nowrap;
		justify-content: flex-start;
	
	}
	text{
		margin:8rpx 0rpx 0rpx 20rpx;
	}
	.heart-echart{
		height:620rpx;
		display:flex;
		flex-direction: column;
		justify-content: flex-start;
		margin:10rpx 20rpx;
		padding-top:20rpx;
		box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
		border-radius: 25rpx;
	}
	.heart-echart view:nth-child(1){
		display: flex;
		flex-direction: column;
		justify-content: flex-start;
	}
	image{
		margin-left: 20rpx;
		width: 50rpx;
		height: 50rpx;
	}
	/* echart图 */
	.echart image{
		width:80%;
		height:80%;
	}
	.tap{
		font-size: 44rpx;
	}

   
	.heart-content{
		width:100%;
		height:80%;
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: flex-start;
	}
	.heart-content>view{
		width:45%;
		height:30%;
		display: flex;
		flex-direction: column;
		flex-wrap: wrap;
		justify-content: flex-start;
		align-items:center;
		margin-top:20rpx;
		margin-left: 20rpx;

	}
	.heart-content view:nth-child(odd){
		 border-right:4rpx dotted #d1d1d1;
	 }
	.heart-overview >view:nth-child(1){
		width: 100%;
		height:20%;
		display: flex;
		flex-direction: row;
		flex-wrap: wrap;
		justify-content: flex-start;
		border-bottom: 4rpx solid #d1d1d1;
		align-items: center;
	}
	.heart-overview{
		height:620rpx;
		display:flex;
		flex-direction: column;
		justify-content: flex-start;
		margin:10rpx 20rpx;
		padding-top:20rpx;
		box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
		border-radius: 25rpx;
	}
</style>